/**
 * 
 */
package com.googlecode.xcarve.cluster;

import java.util.List;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.util.CollectionUtils;

import com.googlecode.xcarve.transport.Client;

/**
 * @author xinyun.d
 * 2014年10月26日
 */
public class DefaultCluster implements Cluster{
	static final Logger logger = LoggerFactory.getLogger(DefaultCluster.class);
	 
	public final List<Client> clientList;
//	private Router router = new ConsistentHashRouter(list);
	public DefaultCluster(List<Client> clientList){
		if( CollectionUtils.isEmpty(clientList))
			  throw new IllegalArgumentException("service cluster cannot be empty.");
		this.clientList = clientList;
	}
	
	@Override
	public List<Client> select(String serviceKey) {
		return clientList;
	}

}
